function search(nums: number[], target: number): number {
    let result: number = 0;
    for (let i of nums) {
        if (i == target) {
            result++;
        }
        if(i > target){
            break;
        }
    }
    return result;
};